/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_VPMEM_H
#define _LINUX_VPMEM_H

#include <linux/kernel.h>
#include <linux/acpi.h>

#define VPMEM_EARYLY_MAX_ENTIES 128

struct vpmem_early_entry {
	u64	addr;
	u64	size;
	u32	node;
} __packed;

struct vpmem_early_table {
	u32	nr_entries;
	struct vpmem_early_entry entries[VPMEM_EARYLY_MAX_ENTIES];
};

/* vpmem memparse function called by kaslr and vpmem early param */
int __init vpmem_memparse(char *p, bool *os_mem_auto, unsigned long *os_mem_size,
			 struct vpmem_early_table *table,
			 int (*fun)(u64 start, u64 to));

int __init vpmem_init_table(struct acpi_table_header *header,
				 struct vpmem_early_table *save_table_ptr);

int __init vpmem_mult_numa_equalize(struct vpmem_early_table *table_vpmem,
					u64 os_mem_size);

unsigned long __init vpmem_get_auto_os_mem_size(struct vpmem_early_table *table_vpmem);

#endif
